/**
 * 标准打印信息封装对象
 * @constructor
 */
function StandardPrintInfo(){
    this.grossWeight = 0;   //毛重 kg
    this.tareWeight = 0;   //皮重 kg
    this.netWeight = 0;   //净重 kg
}

/**
 * 解析打印信息
 */
StandardPrintInfo.prototype.parsing = function (printStr) {
    //解析打印字符，设置重量
    var printLine = printStr.split(/[\r\n]/,11);
    if(printLine.length < 9){
        return;
    }
    alert(printLine);
    var mzStr = printLine[6];
    var pzStr = printLine[7];
    var jzStr = printLine[8];
    this.grossWeight = mzStr.replace(/[^0-9]/ig,"");
    this.tareWeight = pzStr.replace(/[^0-9]/ig,"");
    this.netWeight = jzStr.replace(/[^0-9]/ig,"");

    "METTER TOLEDO SCALE WEIGHING REPORT 08:00 2011/10/28\n" +
    "CN:0023\n" +
    "ID:SUD-A1234\n" +
    "Cargo:CPPER TUBE\n" +
    "Client:Changzhou PORT\n" +
    "Gross Weight:36000 kg\n" +
    "Tare Weight:12000kg\n" +
    "Net Weight:24000kg";

    // this.grossWeight = 36000;
    // this.tareWeight = 12000;
    // this.netWeight = 24000;
}